import time
time_start=time.time()
from math import sqrt
memo={1:2,2:3}
def prime(n):
    j=1
    while memo[j]<int(sqrt(n))+1:
        if n%memo[j]==0:
            break
        j=j+1
    else:
        memo[len(memo)+1]=x
x=5
while True:
   prime(x)
   x=x+2
   if len(memo)>10000:break
print memo[10001]
end_time=time.time()
print end_time-time_start
        
